package com.lrf.eb.service;



import com.lrf.eb.mapper.EbProductCategoryMapper;
import com.lrf.eb.model.EbProductCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service  //业务层----证
public class EbproductCategoryService {
   @Autowired
    private EbProductCategoryMapper ebProductCategoryMapper;

   public Map<String,List<EbProductCategory>> listCategory(){
       //TODO 1.查询所有大类
       List<EbProductCategory> bigCateList = ebProductCategoryMapper.selectBigCategory();
   //TODO 2.查询所有小类
       List<EbProductCategory> smallCateList = ebProductCategoryMapper.selectSmallCategory();
       //TODO 3.将大类和小类封装到Map集合  返回
       Map<String,List<EbProductCategory>> cateMap = new HashMap<>();
       cateMap.put("big",bigCateList);
       cateMap.put("small",smallCateList);
       return cateMap;
   }



}
